<template>
  <div id="app">
    <suspension v-if="moveViewList" :moveViewList="moveViewList"></suspension>
    <div class="fixedBox pointer" @click="toPage('/singlePage')">
      <img class="img" src="@/assets/imgs/common/fixed-icon.png" alt="">
    </div>
    <router-view />
  </div>
</template>
<script>
  import { home } from '@/assets/api/api.js'
  import suspension from '@/views/components/suspension.vue'
  export default {
    components:{
      suspension
    },
    data(){
      return {
        moveViewList:null
      }
    },
    mounted() {
      if(this.$store.state.navList.length == 0){
        this.getNavList()
      }
      this.getMoveView()
    },
    methods:{
      toPage(url){
        this.$router.push(url)
      },
      getMoveView(){
        this.$http(home.activity,{}).then((res)=>{
          this.moveViewList = res.data;
        })
      },
      getNavList(){
        this.$http(home.nav,{}).then((res)=>{
          this.$store.dispatch('toSetNavList',res.data)
        })
      },
    }
  }
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  font-size: 13px;
}

  .fixedBox{
      position: fixed;
      right: 0;
      width: 50px;
      top: 36%;
      z-index: 50;
  }
</style>
